//
// Created by yunnan xu on 2020/12/14.
//

#ifndef ANDROIDGRAPHICSDEMOS_SKYBOXPASS_H
#define ANDROIDGRAPHICSDEMOS_SKYBOXPASS_H

#include "Pass.h"
#include <unordered_map>
#include <string>
#include <EGL/egl.h>
#include <GLES3/gl32.h>

template <GraphicsAPI> class RenderItemStaticOpaque;
template <GraphicsAPI> class CubeMapTexture;


template<GraphicsAPI API> class SkyBoxPass;


template<> class SkyBoxPass<GraphicsAPI::GLESv3> : public GLESPass
{
public:
    SkyBoxPass(std::vector<const char *> cube_map_file_path_list);
    virtual ~SkyBoxPass() = default;
    virtual void Draw();

protected:
    virtual void InitShaderUniformLocation();

private:

    void InitSkyBoxRenderItem();

    std::shared_ptr<CubeMapTexture<GraphicsAPI::GLESv3>> cube_texture;
    std::shared_ptr<RenderItemStaticOpaque<GraphicsAPI::GLESv3>> skybox_item;

    int modelToWorldMatrix_location;
    int skybox_location;
};


#endif //ANDROIDGRAPHICSDEMOS_SKYBOXPASS_H
